home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 11 / CU Amiga Magazine's Super CD-ROM 11 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-06].iso / cucd / programming / oberonv4 / source / system / amigalayers.mod (.txt) < prev    next >
Oberon Text  |  1996-06-02  |  2KB  |  89 lines

  1. Syntax10.Scn.Fnt
  2. Syntax10i.Scn.Fnt
  3. Syntax10b.Scn.Fnt
  4. MODULE AmigaLayers;    (* updated OJ 30 Apr 96 *)
  5. IMPORT
  6.     SYSTEM, E:=AmigaExec, G:=AmigaGraphics;
  7.     layersBase -: E.LibraryPtr;
  8.     layersVersion- : INTEGER;
  9.     termEntry : E.TermEntry;
  10.     dummy : LONGINT;
  11. CONST
  12.     layersName*="layers.library";
  13.     layerSimple*=0;
  14.     layerBackdrop*=6;
  15. PROCEDURE -ReturnD0    04EH,05EH,  04EH,075H;
  16. PROCEDURE BeginUpdate*(l:G.LayerPtr);
  17. BEGIN
  18.     SYSTEM.PUTREG( 8, l );
  19.     SYSTEM.CALL( -78, layersBase )
  20. END BeginUpdate;
  21. PROCEDURE CreateUpfrontLayer*(
  22.            li:G.LayerInfoPtr;
  23.            bm:G.BitMapPtr;
  24.            x0:LONGINT;
  25.            y0:LONGINT;
  26.            x1:LONGINT;
  27.            y1:LONGINT;
  28.            flags:SET;
  29.            superbm:G.BitMapPtr):G.LayerPtr;
  30. BEGIN
  31.     SYSTEM.PUTREG( 8, li );
  32.     SYSTEM.PUTREG( 9, bm );
  33.     SYSTEM.PUTREG( 10, superbm );
  34.     SYSTEM.PUTREG( 0, x0 );
  35.     SYSTEM.PUTREG( 1, y0 );
  36.     SYSTEM.PUTREG( 2, x1 );
  37.     SYSTEM.PUTREG( 3, y1 );
  38.     SYSTEM.PUTREG( 4, flags );
  39.     SYSTEM.CALL( -36, layersBase );
  40.     ReturnD0
  41. END CreateUpfrontLayer;
  42. PROCEDURE DeleteLayer*(layer:G.LayerPtr):BOOLEAN;
  43. BEGIN
  44.     SYSTEM.PUTREG( 9, layer );
  45.     SYSTEM.CALL( -90, layersBase );
  46.     SYSTEM.GETREG( 0, dummy );
  47.     RETURN dummy#E.false
  48. END DeleteLayer;
  49. PROCEDURE DisposeLayerInfo*(li:G.LayerInfoPtr);
  50. BEGIN
  51.     SYSTEM.PUTREG( 8, li );
  52.     SYSTEM.CALL( -150, layersBase )
  53. END DisposeLayerInfo;
  54. PROCEDURE EndUpdate*(layer:G.LayerPtr; completed:BOOLEAN);
  55. BEGIN
  56.     IF completed THEN SYSTEM.PUTREG( 0, E.true)  ELSE  SYSTEM.PUTREG( 0, E.false)  END;
  57.     SYSTEM.PUTREG( 8, layer );
  58.     SYSTEM.CALL( -84, layersBase )
  59. END EndUpdate;
  60. PROCEDURE InstallClipRegion*(layer:G.LayerPtr; region:G.RegionPtr):G.RegionPtr;
  61. BEGIN
  62.     SYSTEM.PUTREG( 8, layer );
  63.     SYSTEM.PUTREG( 9, region );
  64.     SYSTEM.CALL( -174, layersBase );
  65.     ReturnD0
  66. END InstallClipRegion;
  67. PROCEDURE NewLayerInfo*():G.LayerInfoPtr;
  68. BEGIN
  69.     SYSTEM.CALL( -144, layersBase );
  70.     ReturnD0
  71. END NewLayerInfo;
  72. PROCEDURE Init;
  73. TYPE LibraryPtr = POINTER TO E.Library;
  74. VAR lib:LibraryPtr;
  75. BEGIN
  76.     layersBase:=E.OpenLibrary(layersName,37);
  77.     IF layersBase=0 THEN HALT(99) END;
  78.     lib:=SYSTEM.VAL(LibraryPtr,layersBase);
  79.     layersVersion:=lib.version
  80. END Init;
  81. PROCEDURE Term;
  82. BEGIN
  83.     E.CloseLibrary( layersBase )
  84. END Term;
  85. BEGIN
  86.     Init;
  87.     E.Register(termEntry, Term);
  88. END AmigaLayers.
  89.